package itypes

import (
	"github.com/hwcer/logger"
	"github.com/hwcer/updater"
	"server/game/model"
	"server/share/config"
)

var Task = taskIType{}

func init() {
	Task.IType = *NewIType(config.ITypeTask)
	Task.SetCreator(taskCreator)
	if err := updater.Register(updater.ParserTypeCollection, updater.RAMTypeMaybe, &model.Task{}, &Task); err != nil {
		logger.Panic(err)
	}
}

func taskCreator(u *updater.Updater, iid int32, val int64) (any, error) {
	return model.NewTask(u, iid, val), nil
}

type taskIType struct {
	IType
}
